package br.com.nooclix.salon.ui.util
{
	import flash.display.DisplayObject;
	
	import mx.controls.Alert;
	import mx.core.Application;
	import mx.managers.PopUpManager;

	public class WindowsMessage
	{
		
		[Embed(source="../icons/alert/iconAlert.png")]
		[Bindable]
		private static var iconAlert:Class;
		
		[Embed(source="../icons/alert/iconOK.png")]
		[Bindable]
		private static var iconOK:Class;
		
		[Embed(source="../icons/alert/iconError.png")]
		[Bindable]
		private static var iconError:Class;
		
		[Embed(source="../icons/alert/iconQuestion.png")]
		[Bindable]
		private static var iconQuestion:Class;
		
		private static var alert:Alert;
		
		public function WindowsMessage()
		{
			
		}
		
		private static function defaultConfiguration():void{	
			
			alert.setStyle("backgroundColor", 26316);
			alert.setStyle("borderColor", 26316);
			
		}
		
		public static function confirm(message:String):Alert{
			
			alert = Alert.show(message, "Confirmação", 4, null, null, iconOK);
			alert.iconClass = iconAlert;
			defaultConfiguration();
			
			return alert;
			
		}
		
		public static function alarm(message:String):Alert{
			
			alert = Alert.show(message, "Alerta", 4, null, null, iconAlert);
			alert.iconClass = iconAlert;
			defaultConfiguration();
			
			return alert;
			
		}
		
		public static function alarmWithTitle(message:String, title:String):Alert{
			
			alert = Alert.show(message, title, 4, null, null, iconAlert);
			alert.iconClass = iconAlert;
			defaultConfiguration();
			
			return alert;
			
		}
		
		public static function error(message:String):Alert{
			
			alert = Alert.show(message, "Erro", 4, null, null, iconError);
			alert.iconClass = iconError;
			defaultConfiguration();
			
			return alert;
			
		}
		
		public static function question(message:String, title:String, fun:Function):Alert{
			
			Alert.yesLabel="Sim";
			Alert.noLabel="Não"
			alert = Alert.show(message, title, (Alert.YES|Alert.NO), null, fun, iconQuestion);
			alert.iconClass = iconQuestion;
			defaultConfiguration();
			
			return alert;
			
		}
		
		
	}
}